<%--
  用户账号信息页面
  Author: ZheL2
  Date: 2023/12/12
  Version: 1.0
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="m" uri="/WEB-INF/tld/mytag.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>我的</title>
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" type="text/css" href="<c:url value='/resources/css/bootstrap.css'/>">
    <link rel="stylesheet" type="text/css" href="<c:url value='/resources/css/style.css' />">
    <script src="<c:url value='/resources/js/bootstrap.bundle.js'/> "></script>
</head>
<body>

    <div class="page-container">
    <header>
        <!-- Top navbar -->
        <jsp:include page="userHeader.jsp"/>
    </header>

    <div class="content" style="display: flex; justify-content: center;">
        <div class="container mt-5" >
            <div class="row justify-content-center">
                <div class="col-lg-4 col-6 border rounded shadow" style=" background-color: #f2f2f2; padding: 20px; min-width: 450px">
                    <h2 class="fw-bold">个人信息</h2><br>
                    <form action="updateUserInfo" method="post">
                        <div class="form-group row ">
                            <label class="col-3 col-form-label">账号：</label>
                            <div class="col-9">
                                <span class="form-control">${sessionScope.user.username}</span>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="nickname" class="col-3 col-form-label">昵称：</label>
                            <div class="col-9">
                                <input type="text" class="form-control" id="nickname" name="nickname" required value="${sessionScope.user.nickname}">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="telephone" class="col-3 col-form-label">电话：</label>
                            <div class="col-9">
                                <input type="tel" class="form-control" id="telephone" name="telephone" required value="${sessionScope.user.telephone}">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="email" class="col-3 col-form-label">邮箱：</label>
                            <div class="col-9">
                                <input type="email" class="form-control" id="email" name="email" required value="${sessionScope.user.email}">
                            </div>
                        </div>

                        <div class="form-group row">
                            <label for="gender" class="col-3 col-form-label">性别：</label>
                            <div class="col-9">
                                <select class="form-control" id="gender" name="gender" required>
                                    <option value="true" ${sessionScope.user.gender == 'true' ? 'selected' : ''}>男</option>
                                    <option value="false" ${sessionScope.user.gender == 'false' ? 'selected' : ''}>女</option>
                                </select><br>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label for="college" class="col-3">学院：</label>
                            <div class="col-9">
                                <select class="form-control" id="college" name="college" required>
                                    <option value="software" ${sessionScope.user.college == 'software' ? 'selected' : ''}>软件学院</option>
                                    <option value="computer" ${sessionScope.user.college == 'computer' ? 'selected' : ''}>计算机学院</option>
                                    <option value="law" ${sessionScope.user.college == 'law' ? 'selected' : ''}>法学院</option>
                                </select><br>
                            </div>
                        </div>
                        <div class="form-group row">
                            <button type="reset" class="btn btn-outline-secondary col-2">重置</button>
                            <div class="col-6"></div>
                            <button type="submit" class="btn btn-outline-success col-4">提交修改</button>
                        </div>
                    </form>
                </div>
            </div>

        </div>
    </div>

    <footer>
        <m:footer/>
    </footer>
</div>

</body>
</html>
